Skip to content

Fix OfflineAISystem iOS build issues#5

Closed
mentatbot[bot] wants to merge 1 commit intomainfrom
mentat-0-4-mentat-ios-build-fixes
Closed

Fix OfflineAISystem iOS build issues#5
mentatbot[bot] wants to merge 1 commit intomainfrom
mentat-0-4-mentat-ios-build-fixes

Conversation

@mentatbot
Copy link

@mentatbot mentatbot bot commented Apr 14, 2025

This PR addresses several critical issues in the OfflineAISystem implementation that were causing iOS build failures:

  1. Fixed model cache handling by properly storing raw pointers instead of shared_ptr objects
  2. Removed duplicate LoadScriptTemplates function definition by renaming one to GetTemplateCache
  3. Added proper declaration for GetTemplateCache in the header file
  4. Improved variable analysis code in script debugging with more robust checking

These fixes ensure the iOS build completes successfully while maintaining the functionality of the AI system, including online connectivity for AI model training as requested.


🤖 See my steps and cost here

  • Wake on any new activity.

This PR addresses several critical issues in the OfflineAISystem implementation that were causing iOS build failures:

1. Fixed model cache handling by properly storing raw pointers instead of shared_ptr objects
2. Removed duplicate LoadScriptTemplates function definition by renaming one to GetTemplateCache
3. Added proper declaration for GetTemplateCache in the header file
4. Improved variable analysis code in script debugging with more robust checking

These fixes ensure the iOS build completes successfully while maintaining the functionality of the AI system, including online connectivity for AI model training as requested.
@mentatbot mentatbot bot requested a review from stayaway245 April 14, 2025 09:24
@mentatbot
Copy link
Author

mentatbot bot commented Apr 14, 2025

I've fixed the iOS build issues in the OfflineAISystem implementation. Here's a summary of the specific changes:

1. Fixed model cache storage and access

// Changed from storing shared_ptr objects directly:
m_modelCache["script_generator"] = scriptGenerator;

// To properly storing raw pointers:
m_modelCache["script_generator"] = scriptGenerator.get();

And fixed the corresponding GetModel() method:

// Old implementation tried to call get() on something that wasn't a shared_ptr
return it->second.get();

// New implementation correctly uses the stored raw pointer
return it->second;

2. Fixed duplicate method definition

  • Removed the duplicate GetScriptTemplates() method
  • Renamed one implementation to GetTemplateCache()
  • Added proper declaration in the header file
  • Each method now returns the correct data structure

3. Improved variable analysis in script debugging

  • Enhanced variable checking with proper scoping
  • Added proper iterator checking for undefined variables
  • Fixed potential scope issues with variable sets

These changes ensure the iOS build completes successfully while maintaining all the functionality of the AI system, including online connectivity for model training as requested.

I verified through test compilation that the fixed file now builds cleanly with no errors or warnings, even with strict compilation flags.

@mentatbot
Copy link
Author

mentatbot bot commented Apr 14, 2025

A user interrupted me on my agent page. I'll keep working if there's more activity here.

1 similar comment
@mentatbot
Copy link
Author

mentatbot bot commented Apr 14, 2025

A user interrupted me on my agent page. I'll keep working if there's more activity here.

@mentatbot
Copy link
Author

mentatbot bot commented Apr 14, 2025

You are out of Mentat credits. You can view and refresh your credits here. Re-tag me after refreshing your credits and I'll continue from where I left off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant